This topic is dedicated to providing a quick overview of the XAML used to create a C1FlexGrid control.
To get started developing, add a c1 namespace declaration in the root element tag. This is the same for WPF and Silverlight. The difference is in where you put the code. In WPF it is in the Window class, and in Silverlight, it is in the UserControl class.
XAML |
Copy Code
|
---|---|
xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" |
Here is an example of C1FlexGrid taken from the FilterRow sample:
Below is the XAML that you can use in WPF for the sample:
WPF XAML |
Copy Code
|
---|---|
<Window x:Class="FilterRow.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" Title="C1FlexGrid: FilterRow" Height="350" Width="700" WindowStartupLocation="CenterScreen" > <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <CheckBox Content="Use '%' as a wildcard" Margin="6" Click="CheckBox_Click" /> <c1:C1FlexGrid Name="_flex" KeyActionTab="MoveAcross" Grid.Row="1"/> </Grid> </Window> |
Here is an example of C1FlexGrid taken from the ColumnPicker sample:
Below is the XAML that you can use in Silverlight for the sample:
Silverlight XAML |
Copy Code
|
---|---|
<UserControl x:Class="ColumnPicker.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" FontFamily="Segoe UI" FontSize="13" d:DesignHeight="300" d:DesignWidth="600"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <StackPanel Orientation="Vertical"> <TextBlock Text="C1FlexGrid" FontSize="14" FontWeight="Bold"/> <TextBlock Text="Right-click column headers to select which columns are displayed." /> <TextBlock Text="Right-click cells to cut/copy/paste/clear the selection." /> <StackPanel Orientation="Horizontal"> <Button Content="Save Current Layout" Click="SaveLayout_Click" Margin="4 0" Padding="6 2"/> <Button Content="Load Saved Layout" Click="LoadLayout_Click" Margin="4 0" Padding="6 2"/> </StackPanel> </StackPanel> <c1:C1FlexGrid Name="_flex" Grid.Row="1" /> </Grid> </UserControl> |